<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>每一点</title>

    <!-- Css (necessary Css) -->
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/bootstrap.min.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/bootstrap-theme.css')}"
          media="all">
    <link rel="stylesheet"
          th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/language-selector-remove-able-css.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/flexslider.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/style.css')}" media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/plugin.css')}" media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/menu.css')}" media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/responsive.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/color.css')}" media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/iconmoon.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/themetypo.css')}"
          media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/assets/css/widget.css')}" media="all">
    <link rel="icon" th:href="${@mvcResourceUrlProvider.getForLookupPath('/ep/images/favicon.ico')}"
          type="image/x-icon"/>
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/layui/css/layui.css')}" media="all">
    <link rel="stylesheet" th:href="${@mvcResourceUrlProvider.getForLookupPath('/ep/css/eleTree.css')}" media="all">
    <!-- jQuery (necessary JavaScript) -->
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/jquery.js')}"></script>
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/bootstrap.min.js')}"></script>
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/modernizr.js')}"></script>
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/menu.js')}"></script>
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/jquery.flexslider-min.js')}"></script>
    <script type="text/javascript"
            th:src="${@mvcResourceUrlProvider.getForLookupPath('/assets/scripts/functions.js')}"></script>
    <script th:src="${@mvcResourceUrlProvider.getForLookupPath('/layui/layui.js')}"></script>
    <script th:src="${@mvcResourceUrlProvider.getForLookupPath('/ep/js/common/common.js')}"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

    <![endif]-->
    <style>
        ul li img.front_img {
            width: 313px;
            height: 100%;
        }

        .fl {
            float: left;
        }

        .item {
            display: flex;
            margin-top: 20px;
            border-bottom: 1px solid #CCCCCC;
        }

        ul li .middle_part {
            width: 260px;
            margin-left: 20px;
            border-right: 1px solid #CCCCCC;
        }

        ul li .middle_part p {
            font-size: 14px;
            line-height: 22px;
            color: #223318;
            font-weight: bold;
        }

        ul li .middle_part p.inner1 {
            height: 48px;
            line-height: 24px;
        }

        ul li .middle_part p.inner2 {
            height: 84px;
            line-height: 28px;
            word-break: break-all;
        }

        ul li .middle_part p.inner3 {
            line-height: 40px;
        }

        ul li .middle_part p.inner4 {
            line-height: 26px;
        }

        ul li .right_part {
            margin-left: 50px;
            margin-top: 100px;
        }

        #main .content ul li > div {
            margin-top: 20px;
            width: 273px;
            height: 196px;
            padding: 0 20px;
        }

        ul li .right_part .inner_text {
            width: 180px;
            height: 68px;
            top: 50%;
            left: 50%;
            font-weight: bold;
            font-size: 20px;
            margin-left: 50px;
            margin-top: -34px;
        }

        ul li .right_part .bottom_btn.several {
            text-align: right;
        }

        ul li .right_part p {
            line-height: 25px;
            text-align: center;
        }

        ul li .right_part .bottom_btn {
            width: 100px;
            position: absolute;
            text-align: center;
        }

        ul li .right_part .bottom_btn.several a:last-child {
            background-color: #37cb58;
            color: rgb(255, 247, 248);
            border: 0;
        }

        ul li p.inner2 a {
            text-decoration: underline;
            color: #43a4fc;
            cursor: pointer;
        }
    </style>
    <div>
        <!-- Header -->
        <div th:replace="../templates/ep/front/crowd/header :: main-header"></div>
        <!-- Header -->
        <div class="layui-container">

            <div id="ep-user-order" lay-title="我的订单">
                <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
                    <ul class="layui-tab-title">
                        <li class="layui-this">全部</li>
                        <li>待付款</li>
                        <li>待发货</li>
                        <li>待收货</li>
                        <li>待评价</li>
                        <li>待退款</li>
                    </ul>
                    <div class="layui-tab-content">
                        <div id="allOrder" class="layui-tab-item layui-show">
                            <ul class="order-list">
                            </ul>
                        </div>
                        <div id="toPay" class="layui-tab-item">
                            <ul class="order-list">
                            </ul>
                        </div>
                        <div id="paySuccess" class="layui-tab-item">
                            <ul class="order-list">
                            </ul>
                        </div>
                        <div id="proSuccess" class="layui-tab-item item_4">
                            <ul class="order-list">
                            </ul>
                        </div>
                        <div id="reSuccess" class="layui-tab-item">
                            <ul class="order-list">
                            </ul>
                        </div>
                        <div id="proError" class="layui-tab-item">
                            <ul class="order-list">
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!--// CopyRight //-->
        <div th:replace="../templates/ep/front/crowd/footer :: footer"></div>
        <!--// CopyRight //-->
    </div>

    <script type="text/javascript">
        layui.config({
            dir: '/layui/'
        }).extend({
            xmSelect: '/ep/lay/extends/xm-select'
        });
        layui.use(['jquery', 'form', 'upload', 'layedit', 'xmSelect', 'element'], function () {
                let $ = layui.jquery,
                    form = layui.form,
                    xmSelect = layui.xmSelect,
                    element = layui.element,
                    $view = $("#ep-user-order");

                //一些事件触发
                element.on('tab(docDemoTabBrief)', function (data) {
                    if (data.index == 0) {
                        initOrderList();
                    }
                    if (data.index == 1) {

                        $.ajax({
                            url: "/order/getOrderInfoByState",
                            type: "post",
                            data: {"state": 1},
                            success: function (data) {
                                if (data.code == 200) {
                                    var data = data.data;
                                    var str = "";
                                    for (var i = 0; i < data.length; i++) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待支付</p>\n" +
                                            "                                            </div>\n" +
                                            // "                                            <div  class=\"several edit_remark layui-btn\"\n" +
                                            // "                                                 style=\"background-color: #fafafa;color: #fafafa;border: 1px solid #CCCCCC; \">\n" +
                                            // "                                                <a class=\"edit_remark\" oid=\"" + data[i].id + "\" remark_info=\"jkjkj\"\n" +
                                            // "                                                   href=\"javascript:void(0);\">修改备注</a>\n" +
                                            // "                                            </div>\n" +
                                            "                                            <div  class=\"several order_cancel layui-btn\"\n" +
                                            "                                                 style=\"background-color: #fafafa;color: #fafafa;border: 1px solid #CCCCCC;\">\n" +
                                            "                                                <a class=\"order_cancel\" oid=\"" + data[i].id + "\"\n" +
                                            "                                                   pay_id=\"1001594254U1210506135117017038\">取消订单</a>\n" +
                                            "                                            </div>\n" +
                                            "                                            <div class=\"several layui-btn\"\n" +
                                            "                                                 style=\"background-color: #FE6500;color: #fafafa\">\n" +
                                            "                                                <a href='/web/project_order_pay?orderId=" + data[i].id + "'  class=\"payment\" pid=\"1012105061351170170620\" rew_id=\"88690\"\n" +
                                            "                                                   >去付款</a>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    $("#toPay .order-list").html(str);
                                }
                            }
                        })
                    }
                    if (data.index == 2) {

                        $.ajax({
                            url: "/order/getOrderInfoByState",
                            type: "post",
                            data: {"state": 3},
                            success: function (data) {
                                if (data.code == 200) {
                                    var data = data.data;
                                    var str = "";
                                    for (var i = 0; i < data.length; i++) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待发货</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    $("#paySuccess .order-list").html(str);
                                }
                            }
                        })
                    }
                    if (data.index == 3) {

                        $.ajax({
                            url: "/order/getOrderInfoByState",
                            type: "post",
                            data: {"state": 5},
                            success: function (data) {
                                if (data.code == 200) {
                                    var data = data.data;
                                    var str = "";
                                    for (var i = 0; i < data.length; i++) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待收货</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    $("#proSuccess .order-list").html(str);
                                }
                            }
                        })
                    }
                    if (data.index == 4) {

                        $.ajax({
                            url: "/order/getOrderInfoByState",
                            type: "post",
                            data: {"state": 6},
                            success: function (data) {
                                if (data.code == 200) {
                                    var data = data.data;
                                    var str = "";
                                    for (var i = 0; i < data.length; i++) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待评价</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    $("#reSuccess .order-list").html(str);
                                }
                            }
                        })
                    }
                    if (data.index == 5) {

                        $.ajax({
                            url: "/order/getOrderInfoByState",
                            type: "post",
                            data: {"state": 8},
                            success: function (data) {
                                if (data.code == 200) {
                                    var data = data.data;
                                    var str = "";
                                    for (var i = 0; i < data.length; i++) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待退款</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    $("#proError .order-list").html(str);
                                }
                            }
                        })
                    }

                })
                ;


                initOrderList();

                function initOrderList() {
                    // 该用户全部订单全部
                    $.ajax({
                        url: "/order/getAllOrderInfo",
                        type: "post",
                        success: function (data) {
                            if (data.code == 200) {
                                console.log(data)
                                var data = data.data;
                                var str = "";
                                for (var i = 0; i < data.length; i++) {
                                    if (data[i].state == 1) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待支付</p>\n" +
                                            "                                            </div>\n" +
                                            // "                                            <div class=\"several layui-btn\"\n" +
                                            // "                                                 style=\"background-color: #fafafa;color: #fafafa;border: 1px solid #CCCCCC; \">\n" +
                                            // "                                                <a class=\"edit_remark\" oid=\"" + data[i].id + "\" remark_info=\"jkjkj\"\n" +
                                            // "                                                   href=\"javascript:void(0);\">修改备注</a>\n" +
                                            // "                                            </div>\n" +
                                            "                                            <div  class=\"several order_cancel layui-btn\"\n" +
                                            "                                                 style=\"background-color: #fafafa;color: #fafafa;border: 1px solid #CCCCCC;\">\n" +
                                            "                                                <a class=\"order_cancel\" oid=\"" + data[i].id + "\"\n" +
                                            "                                                   pay_id=\"1001594254U1210506135117017038\">取消订单</a>\n" +
                                            "                                            </div>\n" +
                                            "                                            <div class=\"several layui-btn\"\n" +
                                            "                                                 style=\"background-color: #FE6500;color: #fafafa\">\n" +
                                            "                                                <a href='/web/project_order_pay?orderId=" + data[i].id + "' class=\"payment\" rid=\"1012105061351170170620\" rew_id=\"88690\"\n" +
                                            "                                                   >去付款</a>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 2) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                            <div class=\"right_part fl\">\n" +
                                            "                                <div class=\"inner_text\">\n" +
                                            "                                    <p>已失效</p>\n" +
                                            "                                    <p>此订单已过期</p></div>\n" +
                                            "                                <div class=\"several layui-btn\" style=\"background-color: #FE6500;margin-left: 150px;color: #fafafa\">\n" +
                                            "                                    <a class=\"order_del\" oid=\"" + data[i].id + "\"\n" +
                                            "                                       pay_id=\"1001594254U1210505180722022972\" href=\"javascript:void(0);\">删除订单</a>\n" +
                                            "                                </div>\n" +
                                            "                            </div>\n" +
                                            "                        </div>\n" +
                                            "                    </li>";
                                    }
                                    if (data[i].state == 3) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待发货</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 4) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>已取消</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 5) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待收货</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 6) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a   href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'  class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待评价</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 7) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>已完成</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }
                                    if (data[i].state == 8) {
                                        str +=
                                            "<li class=\"item\">\n" +
                                            "                        <div>\n" +
                                            "                            <a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\" target=\"_blank\">\n" +
                                            "                                <img class=\"front_img fl\"\n" +
                                            "                                     src=\"/" + data[i].project.cover + "\"></a>\n" +
                                            "                            <div class=\"middle_part fl\">\n" +
                                            "                                <p class=\"inner1\"><a href=\"/web/project_info?projectId=" + data[i].project.projectId + "\"\n" +
                                            "                                                     target=\"_blank\">" + data[i].project.title + "</a></p>\n" +
                                            "                                <p class=\"inner2\">回报档标题：<span>" + data[i].reward.title + "</span> <a target='_blank'  href='/web/view/order/getOrderInfo?orderId=" + data[i].id + "'  target='_blank'   class=\"order_detail\"\n" +
                                            "                                                                                  oid=\"" + data[i].id + "\"\n" +
                                            "                                                                                  >订单详情</a>\n" +
                                            "                                </p>\n" +
                                            "                                <p class=\"inner3\">\n" +
                                            "                                    回报档：<span>￥" + data[i].reward.support + "</span></p>\n" +
                                            "                                <p class=\"inner4\">\n" +
                                            "                                    应付金额：<span>￥" + data[i].total + "</span>\n" +
                                            "                                </p>\n" +
                                            "                            </div>\n" +
                                            "                                        <div class=\"right_part fl\">\n" +
                                            "                                            <div class=\"inner_text\">\n" +
                                            "                                                <p>待退款</p>\n" +
                                            "                                            </div>\n" +
                                            "\n" +
                                            "                                        </div>\n" +
                                            "                                    </div>\n" +
                                            "                                </li>"
                                    }

                                }
                                $("#allOrder .order-list").html(str);
                            }
                        }
                    })
                }

                // $(document).on("click", ".edit_remark", function () {
                //     console.log(this)
                //     var orderId = $(this).attr("oid");
                //     layer.open({
                //         type: 1,
                //         title:"修改备注",
                //         area:["400px","400px"],
                //         scrollbar :false,
                //         content: "<textarea style='height: 400px;' name=\"desc\" placeholder=\"请输入内容\" class=\"layui-textarea\"></textarea>" //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
                //     });
                // })
                $(document).on("click", ".order_cancel", function () {
                    var orderId = $(this).find("a").attr("oid");
                    $.ajax({
                        url: "/web/order/saveOrderSubmit",
                        type: "post",
                        data: {"orderId": orderId, "type": 2},
                        success: function (data) {
                            var data = data.data;
                            if (data.state == 3) {
                                layer.alert('该订单已支付成功', function (index) {
                                    window.location.reload();
                                    layer.close(index);
                                });
                            }
                            if (data.state == 2) {
                                layer.alert('该订单已超时', function (index) {
                                    window.location.reload();
                                    layer.close(index);
                                });
                            }
                            if (data.state == 4) {
                                layer.alert('该订单已取消', function (index) {
                                    window.location.reload();
                                    layer.close(index);
                                });
                            }
                        }
                    })
                })
                $(document).on("click", ".order_del", function () {
                    var orderId = $(this).attr("oid");
                    $.ajax({
                        url: "/web/order/deleteOrderInfo",
                        type: "post",
                        data: {"orderId": orderId},
                        success: function (data) {
                        }
                    })
                });
            }
        )


    </script>